<!--
 * @Author: 周洋 1430536748@qq.com
 * @Date: 2024-08-10 17:01:53
 * @LastEditors: 周洋 1430536748@qq.com
 * @LastEditTime: 2024-08-16 14:56:15
 * @version: 1.2.5
 * @Description: 
-->
<script setup lang="ts">
import ColumnItems from '../column-items/index.vue';
import { props, Emits } from '../props';
const { tableData, align, tableColumns, headerRow } = defineProps(props);
const emit = defineEmits<Emits>()
const onSelection = (rows: any) => {
    const num: number = rows.length;
    const ids: Array<any> = rows.map((i: any) => i.id)
    emit('onSelection', num, ids, rows)
}
</script>
<template>
    <el-table border stripe show-overflow-tooltip fit highlight-current-row style="width: 100%" :data="tableData"
        :height="height" :header-row-style="headerRow" @selection-change="onSelection">
        <ColumnItems :align="align" :tableColumns="tableColumns" :tableData="tableData" />
    </el-table>
</template>
<style scoped lang="scss">
//自定义el-table样式
:deep(.el-table__cell) {
    th {
        background-color: var(--el-fill-color) !important;
    }
}
</style>